<%--
  Created by IntelliJ IDEA.
  User: 95184
  Date: 2024/9/14
  Time: 下午2:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    String username = "";
    Cookie[] cookies = request.getCookies();
    if (cookies != null) {
        for (Cookie cookie : cookies) {
            if (cookie.getName().equals("username")) {
                response.sendRedirect("success.jsp");
            }
        }
    }
%>
<form action="/login" method="post">
    用户名：<input type="text" name="username">
    <br/>
    密码：<input type="password" name="password">
    <br/>
    <input type="checkbox" name="autoLogin"> 两周免登陆
    <br/>
    <input type="submit" value="登录"/>
    <button><a href="register.html">注册</a></button>
</form>
</body>
</html>
